﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace WpfApp1.Models
{
    /// <summary>
    /// WPF端采用树状结构目录的基础类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [Serializable]
    public class TreeBase<T>
    {
        private bool isLinked = false;
        /// <summary>
        /// 是否已创建连接
        /// </summary>
        public bool IsLinked
        {
            get { return isLinked; }
            set { isLinked = value; }
        }

        /// <summary>
        /// 父节点
        /// </summary>
        public T Parent { get; set; }

        /// <summary>
        /// 子节点
        /// </summary>
        public ObservableCollection<T> Children { get; set; }
    }

    /// <summary>
    /// 具体的实现类，用于相关管理的目录数建设
    /// </summary>
    [Serializable]
    public class Item : TreeBase<Item>
    {

        public string Id { get; set; }

        public string ParentID { get; set; }

        public string DisplayText { get; set; }


    }
}
